<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>wacth</title>

</head>
<body>
<div id="app">
    <input v-model="user.name">
</div>

<script src="./node_modules/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            user: {
                id: 10086,
                name: "刘德华"
            }
        },
        watch: {
            user:{
                deep:true,
                handler(val,oldval){
                    console.log(val,oldval)
                }
            }
        }

    })
</script>
</body>
</body>
</html>